// 本地 存处
const storage = localStorage
// 存
const setStorage = (key, vale) => {
  if (vale && typeof vale === 'object') { vale = JSON.stringify(vale) }
  storage.setItem(key, vale)
}
// 取
const getStorage = (key) => {
  try {
    return JSON.parse(storage.getItem(key))
  } catch (e) {
    storage.getItem(key)
  }
}
// 删
const removeStorage = (key) => {
  storage.removeItem(key)
}

export {
  setStorage,
  getStorage,
  removeStorage
}
